const MonacoWebpackPlugin = require('monaco-editor-webpack-plugin');
module.exports = {
	publicPath: process.env.VUE_APP_PATH,
	lintOnSave: false,
	//开发模式反向代理配置，生产模式请使用Nginx部署并配置反向代理
	devServer: {
		open: true,
		proxy: {
			'/blade-visual': {
				//本地服务接口地址
				target: 'http://192.168.1.239:8082',
				changeOrigin: true,
				ws: true,
				pathRewrite: { '/^/blade-visual': '' }
			},
			'/api': {
				target: 'http://192.168.1.196:88',
				changeOrigin: true,
				ws: true,
				pathRewrite: {
					'^/api': '/'
				}
			}
		}
	},
	css: {
		loaderOptions: {
			sass: {
				implementation: require('sass') // This line must in sass option
			}
		}
	},
	configureWebpack: {
		plugins: [new MonacoWebpackPlugin()]
	},
	transpileDependencies: ['monaco-editor', '@jiaminghi/data-view'],
	chainWebpack: config => {
		'source-map',
			//忽略的打包文件
			config.externals({
				vue: 'Vue',
				'vue-router': 'VueRouter',
				vuex: 'Vuex',
				axios: 'axios',
				'element-ui': 'ELEMENT'
			});
	}
};
